[Experiment]: Factory Pattern + Observability + JSDoc Types#59
Draft
AlbertSmit wants to merge 12 commits intomainfrom
Draft
[Experiment]: Factory Pattern + Observability + JSDoc Types#59AlbertSmit wants to merge 12 commits intomainfrom
AlbertSmit wants to merge 12 commits intomainfrom
Conversation
- Add types - Fix typescript configuration - Remove coverage tool - Remove outdated firebase test package (move towards Firebase tools) - Switch to pnpm
…f strategies, add queue management features including pause/resume and statistics, and enhance worker lifecycle tracking with heartbeats and concurrency
…nd queue pause/resume functionality.
…tured logging and metrics for task lifecycle events.
…er to factory functions and add error reporting to retry scheduler.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Member
|
@AlbertSmit Make sure to base any pull request on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is an experiment/brain-child exploring v2.0 improvements.
Not in a finished state. Welcome to discuss.
Overview
This PR introduces v2.0 of
@kaliber/firebase-queuewith breaking changes and significant improvements driven by real-world usage analysis.Why These Changes?
Usage Analysis
Analyzed 7 projects and 18 services:
Code Quality Issues
The original codebase had several code smells:
Queueusednewkeyword but was not a real constructor (nothis, weirdinstanceofcheck)process()was 155 lines with 6 nested functionsFeature Gap vs BullMQ
Breaking Changes⚠️
Factory functions instead of constructors:
Rationale: The old
new Queue()pattern was a pseudo-class that did not actually usethis- it was a factory function pretending to be a constructor. Converting to explicit factory functions makes the code honest and consistent.New Features ✨
🔴 P0: Retry with Backoff
Previously manually implemented in rabobank-jobs (~50 lines)
🟡 P1: Pause/Resume
Previously manually implemented in synchronization-service
Observability
Lifecycle Hooks
Queue Stats
Code Quality Improvements
task_helpers.js(smaller, focused functions)Testing